<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset=utf-8"UTF-8">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>自动计算绩点</title>
    <link rel="stylesheet" th:href="@{/bootstrap.min.css}">
    <style>
        .xiaoacao_footer{
            height: 30px;
            line-height: 35px;
            position: fixed;
            bottom: 0;
            width: 100%;
            text-align: center;
            background-color: darkslategrey;
            color: #fff;
            font-family: Arial;
            font-size: 14px;
            letter-spacing: 1px;
        }
        .xiaoacao_footer a {
            text-decoration: none;
        }
        .xiaoacao_footer a:link {
            text-decoration: none;
        }
        .xiaoacao_footer a:visited {
            text-decoration: none;
        }
        .xiaoacao_footer a:hover {
            text-decoration: none;
        }
        .xiaoacao_footer a:active {
            text-decoration: none;
        }
        .xiaoacao_footer a:focus {
            text-decoration: none;
        }
    </style>
</head>
<body>

<center>
    <div class="edu-container-new" style="margin-top: 200px">
        <div class="edu-content-new">
            <form id="loginForm" name="loginForm" th:action="@{~/api/Login}" method="post">
                <input type="hidden" name="loginMethod" value="LoginToXk">
                <div class="rt login-form-new">
                    <h2>请输入教学系统账号密码</h2>
                    <p style="margin-bottom: 12px">&nbsp;&nbsp;</p>
                    <div style="width: 300px;height: 200px;">
                        <div class="form-item-new">
                            <div class="input-group mb-3">
                                <div class="input-group-prepend">
                                    <span class="input-group-text" id="inputGroup-sizing-default">账号</span>
                                </div>
                                <input type="text" aria-label="账号" class="form-control" id="userAccount"
                                       name="userAccount" placeholder="请输入账号">
                            </div>
                        </div>
                        <div class="form-item-new">
                            <div class="input-group mb-3">
                                <div class="input-group-prepend">
                                    <span class="input-group-text" id="inputGroup-sizing-default1">密码</span>
                                </div>
                                <input type="password" aria-label="密码" class="form-control" id="userPassword"
                                       name="userPassword" placeholder="请输入密码">
                            </div>
                        </div>
                    </div>
                    <div class="form-item">
                        <font color="red" size="2" id="showMsg"> </font>
                    </div>
                    <a class="btn btn-primary" id="btn-login" onclick="login()">登录</a>
                    <div class="form-item">
                    </div>
                    <input type="hidden" id="encoded" name="encoded">
                </div>
            </form>
        </div>
    </div>
    <div class="xiaoacao_footer">
        <p>Copyright©2022-2024 <a href="http://www.pzhuweb.cn/" target="_blank">BY:WEB-KK</a> .All Rights Reserved</p>
    </div>
</center>
</body>
<script type="text/javascript" th:src="@{/js/a.js}"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script type="application/javascript">
    function login() {
        var xh = document.getElementById("userAccount").value;
        var pwd = document.getElementById("userPassword").value;
        if ($("#userAccount").val() == "") {
            $("#showMsg").text("请输入账号");
            $("#userAccount").focus();
            return false;
        }
        if ($("#userPassword").val() == "") {
            $("#showMsg").text("请输入密码");
            $("#userPassword").focus();
            return false;
        }
        var account = encodeInp(xh);

        var passwd = encodeInp(pwd);
        var encoded = account + "%%%" + passwd;
        document.getElementById("encoded").value = encoded;
        document.getElementById('loginForm').submit();
    }
</script>
</html>